﻿using System;
using System.Configuration;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

using ZhimeiSoft.Framework.Common.RefectUtils;
using ZhimeiSoft.CharmManager.Server.BLL.Interface;

namespace ZhimeiSoft.CharmManager.Server.Factory
{
    public class BaseBLLFactory
    {

        private static readonly string path = System.Configuration.ConfigurationManager.AppSettings["BusinessBLLImpl"];

        private BaseBLLFactory()
        {

        }

        public static IEmployeeBLL CreateEmployeeBLL()
        {
            string className = path + ".EmployeeBLL";
            return (IEmployeeBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static ICustomerBLL CreateCustomerBLL()
        {
            string className = path + ".CustomerBLL";
            return (ICustomerBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static IEmployeeVacationBLL CreateEmployeeVacationBLL(){
            string className = path + ".EmployeeVacationBLL";
            return (IEmployeeVacationBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static ISalonInfoBLL CreateSalonInfoBLL()
        {
            string className = path + ".SalonInfoBLL";
            return (ISalonInfoBLL)Assembly.Load(path).CreateInstance(className);
        }

        public static IScheduleBLL CreateScheuleBLL()
        {
            string className = path + ".ScheuleBLL";
            return (IScheduleBLL)Assembly.Load(path).CreateInstance(className);
        }
    }
}
